package profit

import "yundian/internel/pkg/dingo"

type ProfitAttr func(model *ProfitModel)

type ProfitAttrs []ProfitAttr

func (attrFunc ProfitAttrs) Alppy(model *ProfitModel) {
	for _, f := range attrFunc {
		f(model)
	}
}

func WithUserID(userID int) ProfitAttr {
	return func(model *ProfitModel) { model.UserID = userID }
}

func WithSharedMode(sharedMode string) ProfitAttr {
	return func(model *ProfitModel) { model.SharedMode = sharedMode }
}

func WithDeviceTypeId(deviceTypeId int) ProfitAttr {
	return func(model *ProfitModel) { model.DeviceTypeId = deviceTypeId }
}

func WithProfitType(profitType int) ProfitAttr {
	return func(model *ProfitModel) { model.ProfitType = profitType }
}

func WithProfitIsVisible(profitIsVisible int) ProfitAttr {
	return func(model *ProfitModel) { model.ProfitIsVisible = profitIsVisible }
}

func WithProfitProportion(profitProportion int) ProfitAttr {
	return func(model *ProfitModel) { model.ProfitProportion = profitProportion }
}

func WithPlaceId(placeId int) ProfitAttr {
	return func(model *ProfitModel) { model.PlaceId = placeId }
}

func WithCreateAt(createAt dingo.Time) ProfitAttr {
	return func(model *ProfitModel) { model.CreateAt = createAt }
}

func WithUpdateAt(updateAt dingo.Time) ProfitAttr {
	return func(model *ProfitModel) { model.UpdateAt = updateAt }
}
